﻿//<![CDATA[

// When opening a dialog, its "definition" is created for it, for
// each editor instance. The "dialogDefinition" event is then
// fired. We should use this event to make customizations to the
// definition of existing dialogs.
CKEDITOR.on('dialogDefinition', function(ev) {
    // Take the dialog name and its definition from the event
    // data.
    var dialogName = ev.data.name;
    var dialogDefinition = ev.data.definition;

    if (dialogName == 'image') {
        // FCKConfig.ImageDlgHideAdvanced = true	
        dialogDefinition.removeContents('advanced');
        // FCKConfig.ImageDlgHideLink = true
        dialogDefinition.removeContents('Link');

        var infoTab = dialogDefinition.getContents('info');

        //infoTab.remove('txtWidth');
        infoTab.remove('txtHeight');
        //infoTab.remove('txtBorder');
        //infoTab.remove('txtHSpace');
        //infoTab.remove('txtVSpace');
        //infoTab.remove('cmbAlign');
    }

    if (dialogName == 'flash') {
        // FCKConfig.FlashDlgHideAdvanced = true
        dialogDefinition.removeContents('advanced');
        dialogDefinition.removeContents('properties');
        var infoTab = dialogDefinition.getContents('info');

        //infoTab.remove('width');
        //infoTab.remove('height');
        infoTab.remove('hSpace');
        infoTab.remove('vSpace');

        //dialogDefinition.getContents('info','width').value = 500;
    }

    // Check if the definition is from the dialog we're
    // interested on (the "Link" dialog).
    if (dialogName == 'link') {

        dialogDefinition.removeContents('advanced');

        // FCKConfig.LinkDlgHideTarget = true
        dialogDefinition.removeContents('target');

        // Get a reference to the "Link Info" tab.
        var infoTab = dialogDefinition.getContents('info');

        // Remove the "Link Type" combo and the "Browser
        // Server" button from the "info" tab.
        infoTab.remove('linkType');
        infoTab.remove('browse');
    }
});

//]]>